/**
 * This file is part of the CAKIS project.
 * 
 * Copyright (c) 2009-2010 - Florian Arndt, Christian Kerl
 * 
 * @license GNU Lesser General Public License v3 <http://www.opensource.org/licenses/lgpl-3.0.html>
 * @since   01.03.2010
 * @version SVN: $Id: ProductLookupServiceRegistry.java 43 2010-03-27 17:45:25Z christian-kerl@web.de $
 */

package org.cakis.server.service;

import java.util.List;

import org.cakis.server.model.Product;

/**
 * ProductLookupServiceRegistry provides methods to manage multiple {@link ProductLookupService}
 * instances and to query them for product information.
 * 
 * @author Christian Kerl
 */
public interface ProductLookupServiceRegistry {

    /**
     * Gets all managed {@link ProductLookupService} instances.
     * 
     * @return
     */
    List<ProductLookupService> getServices();

    /**
     * Gets the {@link ProductLookupService} instance with the given name or null if none exists.
     * 
     * @param name
     * @return
     */
    ProductLookupService getServiceByName(String name);

    /**
     * Adds the given {@link ProductLookupService} instance to the registry.
     * 
     * @param service
     */
    void addService(ProductLookupService service);

    /**
     * Removes the given {@link ProductLookupService} instance from the registry.
     * 
     * @param service
     */
    void removeService(ProductLookupService service);

    /**
     * Queries all managed {@link ProductLookupService} instances and returns the first
     * product that is found or null if none is found.
     * 
     * @param ean
     * @return
     */
    Product getProductInformation(String ean);
}
